<template>
	<view class="shortcut-menu">
		<view @click="navToHome">
			<view>
				<image src="https://7463-tcb-zoumbaexjdidjmj2ff212-5d3479-1303238310.tcb.qcloud.la/static/img/ic_shouye_fd@2x.png"></image>
			</view>
			<view>首页</view>
		</view>
		<view class="line"></view>
		<view>
			<view>
				<image src="https://7463-tcb-zoumbaexjdidjmj2ff212-5d3479-1303238310.tcb.qcloud.la/static/img/ic_fenxiang_anniu@2x.png"></image>
			</view>
			分享
		</view>
		<view class="line"></view>
		<view @click="navToOrder">
			<view>
				<image src="https://7463-tcb-zoumbaexjdidjmj2ff212-5d3479-1303238310.tcb.qcloud.la/static/img/ic_dingdan_fd@2x.png"></image>
			</view>
			订单
		</view>
	</view>
</template>

<script>
	import {
		mapState
	} from "vuex"
	export default {
		name:"shortcut-menu",
		data() {
			return {
				
			};
		},
		computed: {
			...mapState(["userInfo"])
		},
		methods: {
			showLoginModal() {
				uni.showModal({
					title: "您还未登陆，请先登录！",
					cancelText: "再看看",
					confirmText: "去登陆",
					success: (res) => {
						if (res.confirm) {
							uni.navigateTo({
								url: "../../pagesFoo/public/login"
							})
						}
					}
				})
			},
			navToHome() {
				uni.switchTab({
					url: "../../pages/platform/goods-list"
				})
			},
			navToOrder() {
				if (!this.userInfo._id) {
					this.showLoginModal()
					return
				}
				uni.navigateTo({
					url: "../../pagesFoo/order/order"
				})
			}
		}
	}
</script>

<style scoped>
	.shortcut-menu {
		position: fixed;
		bottom: calc(50px + 94rpx);
		/* #ifndef H5 */
		bottom: 94rpx;
		/* #endif */
		z-index: 998;
		background-color: rgba(0, 0, 0, 0.6);
		color: #FFFFFF;
		width: 68rpx;
		border-radius: 34rpx;
		padding: 24rpx 0;
		text-align: center;
	}
	view {
		font-size: 24rpx;
	}
	image {
		width: 40rpx;
		height: 40rpx;
	}
	.line {
		height: 1px;
		width: calc(100% - 16rpx);
		background-color: rgba(255, 255, 255, 0.3);
		margin: 6rpx 8rpx;
	}
</style>
